package com.csweimei.rentmanagementtreasure.tenant.ui.act.house;

import androidx.lifecycle.ViewModelProviders;

import android.os.Bundle;

import com.chad.library.BR;
import com.csweimei.rentmanagementtreasure.R;
import com.csweimei.rentmanagementtreasure.base.AppConfig;
import com.csweimei.rentmanagementtreasure.base.AppViewModelFactory;
import com.csweimei.rentmanagementtreasure.databinding.ActivityHouseDetailBinding;
import com.csweimei.rentmanagementtreasure.tenant.viewModel.HouseDetailZzVM;

import me.goldze.mvvmhabit.base.BaseActivity;

public class HouseDetailZzActivity extends BaseActivity<ActivityHouseDetailBinding, HouseDetailZzVM> {


    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_house_detail;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    int houseId;
    String type;
    @Override
    public void initParam() {
        super.initParam();
        houseId = getIntent().getIntExtra(AppConfig.BUNDLE_KEY,0);
        type = getIntent().getStringExtra(AppConfig.BUNDLE_KEY2);
    }

    @Override
    public void initData() {
        super.initData();
        viewModel.setActivity(this);
        viewModel.houseId.set(houseId+"");
        viewModel.type.set(type+"");
        viewModel.setRecy(binding.imgRecy);
        viewModel.setShareView(binding.shareView);
    }

    @Override
    public HouseDetailZzVM initViewModel() {
        AppViewModelFactory factory = AppViewModelFactory.getInstance(getApplication());
        return ViewModelProviders.of(this,factory).get(HouseDetailZzVM.class);
    }
}